Skip to content

refactor: remove the keyword and syntax previously necessary to work with environment variables in favour of an additional optional property 'env'#124

Merged
arthurpalves merged 5 commits intodevelopfrom
refactor/121-modify-envvars-syntax
Feb 2, 2021
Merged

refactor: remove the keyword and syntax previously necessary to work with environment variables in favour of an additional optional property 'env'#124
arthurpalves merged 5 commits intodevelopfrom
refactor/121-modify-envvars-syntax

Conversation

@arthurpalves
Copy link
Copy Markdown
Member

@arthurpalves arthurpalves commented Jan 29, 2021

What does this PR do

  • Remove the syntax necessary to work with environment variables in custom properties;
  • Add optional property env to CustomProperty type, whose default value is set to false;
  • Internally, decode optional Bool to non-optional isEnvironmentVariable.

How can it be tested

  • Adhere to the latest changes in variants.yml
  • Include a custom property whose value reads from environment variable:
 - name: sample_property
    value: NAME_OF_ENV_VAR
    env: true
    destination: project
  • Switch to this respective variant variants switch --variant A_VARIANT
  • IF iOS Variants.swift should contain struct Secrets with your encrypted static var.
  • IF Android gradleScripts/variants.gradle should contain:
System.getenv('NAME_OF_ENV_VAR')

Task

resolves #121

Checklist:

  • I ran make validation locally with success
  • I have not introduced new bugs
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented on my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new errors

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 29, 2021

Codecov Report

Merging #124 (82caaee) into develop (c68e33f) will increase coverage by 0.32%.
The diff coverage is 81.81%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #124      +/-   ##
===========================================
+ Coverage    62.09%   62.42%   +0.32%     
===========================================
  Files           31       30       -1     
  Lines         1100     1099       -1     
===========================================
+ Hits           683      686       +3     
+ Misses         417      413       -4     
Impacted Files Coverage Δ
...riantsCore/Factory/FastlaneParametersFactory.swift 28.37% <0.00%> (+1.10%) ⬆️
Sources/VariantsCore/Schemas/Configuration.swift 95.83% <95.45%> (-4.17%) ⬇️
...antsCore/Factory/Android/GradleScriptFactory.swift 89.33% <100.00%> (+0.87%) ⬆️
Sources/VariantsCore/Schemas/iOS/iOSVariant.swift 97.61% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c68e33f...70fa69e. Read the comment docs.

@arthurpalves arthurpalves requested a review from gderaco February 1, 2021 08:31
@arthurpalves arthurpalves merged commit acc3a72 into develop Feb 2, 2021
@arthurpalves arthurpalves deleted the refactor/121-modify-envvars-syntax branch February 2, 2021 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Modify syntax that supports environment variable values

1 participant